package com.tedu.pojo;

import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author Song
 * @since 2020/10/30
 */
@Data
@Accessors(chain = true)
public class PageObject<T> {

        private Integer rowCount;
        private Integer pageCount;
        private Integer pageCurrent;
        private List<T> records;
        private Integer pageSize;

    public PageObject(Integer rowCount, Integer pageCurrent, List<T> records, Integer pageSize) {
        this.rowCount = rowCount;
        this.pageCurrent = pageCurrent;
        this.records = records;
        this.pageSize = pageSize;
        this.pageCount = rowCount/pageSize;
        if (rowCount%pageSize!=0){
            this.pageCount++;
        }
    }
}
